home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / config.sub < prev    next >
Text File  |  1993-07-18  |  5KB  |  187 lines

  1. #!/bin/sh
  2. # Configuration validation subroutine script, version 1.0.
  3. #   Copyright (C) 1991 Free Software Foundation, Inc.
  4.  
  5. #This file is free software; you can redistribute it and/or modify
  6. #it under the terms of the GNU General Public License as published by
  7. #the Free Software Foundation; either version 2 of the License, or
  8. #(at your option) any later version.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program; if not, write to the Free Software
  17. #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.  
  20. # Configuration subroutine to validate and canonicalize a configuration type.
  21. # Supply the specified configuration type as an argument.
  22. # If it is invalid, we print an error message on stderr and exit with code 1.
  23. # Otherwise, we print the canonical config type on stdout and succeed.
  24.  
  25. # This file is supposed to be the same for all GNU packages
  26. # and recognize all the CPU types, system types and aliases
  27. # that are meaningful with *any* GNU software.
  28. # Each package is responsible for reporting which valid configurations
  29. # it does not support.  The user should be able to distinguish
  30. # a failure to support a valid configuration from a meaningless
  31. # configuration.
  32.  
  33. # Separate what the user gave into CPU/company and OS (if any).
  34. basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  35. if [ $basic_machine != $1 ]
  36. then os=`echo $1 | sed 's/[^-]*-/-/'`
  37. else os=; fi
  38.  
  39. # Decode aliases for certain machine/company combinations.
  40. case $basic_machine in
  41.     # Recognize the basic CPU types without company name.
  42.     vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
  43.         | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
  44.         | rtpc | rs6000)
  45.         ;;
  46.     # Recognize the basic CPU types with company name.
  47.     vax-* | tahoe-* | i386-* | i860-* | m68k-* | m68000-* | m88k-* \
  48.           | sparc-* | ns32k-* | alliant-* | arm-* | c1-* | c2-* \
  49.           | mips-* | pyramid-* | tron-* | a29k-* | rtpc-* | rs6000-*)
  50.         ;;
  51.     # Recognize the machine names
  52.     # which stand for a CPU time and a company.
  53.     iris | iris4d)
  54.         basic_machine=mips-sgi
  55.         ;;
  56.     news | news800)
  57.         basic_machine=m68k-sony
  58.         ;;
  59.     3b1 | 7300 | 7300-att | att-7300)
  60.         basic_machine=m68k-att
  61.         ;;
  62.     delta | 3300 | motorola-3300 | motorola-delta \
  63.           | 3300-motorola | delta-motorola)
  64.         basic_machine=m68k-motorola
  65.         ;;
  66.     vax-dec)
  67.         basic_machine=vax
  68.         ;;
  69.     balance)
  70.         basic_machine=ns32k-sequent
  71.         ;;
  72.         mmax)
  73.         basic_machine=ns32k-encore
  74.         ;;
  75.         pc532)
  76.         basic_machine=ns32k-pc532
  77.         ;;
  78.     symmetry)
  79.         basic_machine=i386-sequent
  80.         ;;
  81.     sun2)
  82.         basic_machine=m68000-sun
  83.         ;;
  84.     sun3)
  85.         basic_machine=m68k-sun
  86.         ;;
  87.     sun4)
  88.         basic_machine=sparc-sun
  89.         ;;
  90.     pbd)
  91.         basic_machine=sparc-unicom
  92.         ;;
  93.     sun386 | sun386i)
  94.         basic_machine=i386-sun
  95.         ;;
  96.     ps2)
  97.         basic_machine=i386-ibm
  98.         ;;
  99.     next)
  100.         basic_machine=m68k-next
  101.         ;;
  102.     hp9k3[2-9][0-9])
  103.         basic_machine=m68k-hp
  104.         ;;
  105.     hp9k31[0-9] | hp9k2[0-9][0-9])
  106.         basic_machine=m68000-hp
  107.         ;;
  108.     isi68)
  109.         basic_machine=m68k-isi
  110.         ;;
  111.     apollo68)
  112.         basic_machine=m68k-apollo
  113.         ;;
  114.     altos | altos3068)
  115.         basic_machine=m68k-altos
  116.         ;;
  117.     miniframe)
  118.         basic_machine=m68000-convergent
  119.         ;;
  120.     tower | tower-32)
  121.         basic_machine=m68k-ncr
  122.         ;;
  123.     news-3600 | risc-news)
  124.         basic_machine=mips-sony
  125.         ;;
  126.     decstation | decstation-3100 | pmax)
  127.         basic_machine=mips-dec
  128.         ;;
  129.     magnum | m3230)
  130.         basic_machine=mips-mips
  131.         ;;
  132.     gmicro)
  133.         basic_machine=tron
  134.         ;;
  135.     convex-c1)
  136.         basic_machine=c1-convex
  137.         ;;
  138.     convex-c2)
  139.         basic_machine=c2-convex
  140.         ;;
  141.     *)
  142.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  143.         exit 1
  144.         ;;
  145. esac
  146.  
  147. # Decode manufacturer-specific aliases for certain operating systems.
  148.  
  149. if [ "$os" ]
  150. then
  151. case $os in
  152.     # First accept the basic system types.
  153.     # The portable systems comes first.
  154.     # Each alternative must end in a *, to match a version number.
  155.     -bsd* | -sysv* | -mach* | -minix*\
  156.           | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
  157.           | -unos* | -osf* | -v88r* | -luna* | -dgux*)
  158.         ;;
  159.     -newsos*)
  160.         os=-bsd
  161.         ;;
  162.     -ultrix*)
  163.         os=-bsd
  164.         ;;
  165.     -osfrose*)
  166.         os=-osf
  167.         ;;
  168.     -osf*)
  169.         os=-bsd
  170.         ;;
  171.     -dynix*)
  172.         os=-bsd
  173.         ;;
  174.     -ctix*)
  175.         os=-sysv
  176.         ;;
  177.     *)
  178.         # Get rid of the `-' at the beginning of $os.
  179.         os=`echo $1 | sed 's/[^-]*-//'`
  180.         echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  181.         exit 1
  182.         ;;
  183. esac
  184. fi
  185.  
  186. echo $basic_machine$os
  187.